package com.czz.vod.controller;

import com.czz.common.vo.R;
import com.czz.vod.service.VideoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName: VideoPortalController
 * @Author Czz
 * @Date 2020/2/8
 * @Time 20:25
 **/
@RestController
@RequestMapping(value = "/portal/")
public class VideoPortalController {

    @Autowired
    VideoService videoService;

    @GetMapping(value = "/get-play-auth/{videoId}")
    public R getVideoPlayAuth(@PathVariable("videoId") String videoId) {
        ///得到播放凭证
        String playAuth = videoService.getVideoPlayAuth(videoId);
        //返回结果
        return R.ok().message("获取凭证成功").data("playAuth", playAuth);
    }
}
